package com.gyx.rocsun.service.impl;

import com.gyx.rocsun.common.utils.ThreadUtil;
import com.gyx.rocsun.service.CacheService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class CacheServiceImpl implements CacheService {

    @Override
    @Cacheable(value = "CacheService", key = "'SIMPLE_CACHE_' + #keyword")
    public String query(String keyword) {
        ThreadUtil.sleep(1000);
        return "我是一个小缓存_" + keyword;
    }

}
